feat(test): add SKIP_V4 e SKIP_V5 for test#345
Open
cesco69 wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
@dimdenGD Do we really want to try to support Express 5? With this PR, we can run tests that can only run on v4 or v5 (or both), allowing us to try to support both in the same branch. If we can support both (v4 and v5), would you accept PRs? |
Contributor
|
I think it should be possible to support both V4 and V5 in the same branch, but only if we add some kind of option that allows us to determine whether the framework should behave as V4 or V5. For example: const express = require("ultimate-express");
const app = express({ version: 5 }); // default is 4Some behaviors changed in V5, so we need a way to handle things differently depending on the version we want to support. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for per-version skip markers in the test runner, allowing individual tests to skip execution against a specific Express version (v4 or v5) while still running the remaining comparisons.
Motivation
Some tests exercise features that are removed or fundamentally changed in Express 5 (e.g.
app.del(), deprecatedapp.param()callback syntax). These tests crash Express 5 with an ERROR, adding noise to the test output. We want to skip only the problematic version and still validate against the other.Implementation
The marker is read from the second line of each test file as a comment:
Supported markers
SKIP_V5: reasonSKIP_V4: reasonOFF: reasont.skip())Diagnostic output
When a version is skipped, the runner emits a diagnostic with the reason:
Behavior
^\/\/\s*(SKIP_V4|SKIP_V5|OFF)(?::\s*(.*))?$):is optional but recommended for documentationTest changed
tests/tests/app/app-delete.js— annotated withSKIP_V5tests/tests/app/app-param-deprecated.js— annotated withSKIP_V5